home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / setcomment.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-13  |  2.0 KB  |  83 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: setcomment.c,v 1.2 1996/09/13 17:50:09 digulla Exp $
  4.     $Log: setcomment.c,v $
  5.     Revision 1.2  1996/09/13 17:50:09  digulla
  6.     Use IPTR
  7.  
  8.     Revision 1.1  1996/09/11 12:54:47  digulla
  9.     A couple of new DOS functions from M. Fleischer
  10.  
  11.     Desc:
  12.     Lang: english
  13. */
  14. #include <clib/exec_protos.h>
  15. #include <dos/dosextens.h>
  16. #include <dos/filesystem.h>
  17. #include <clib/dos_protos.h>
  18. #include "dos_intern.h"
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.     #include <clib/dos_protos.h>
  24.  
  25.     __AROS_LH2(BOOL, SetComment,
  26.  
  27. /*  SYNOPSIS */
  28.     __AROS_LHA(STRPTR, name,    D1),
  29.     __AROS_LHA(STRPTR, comment, D2),
  30.  
  31. /*  LOCATION */
  32.     struct DosLibrary *, DOSBase, 30, Dos)
  33.  
  34. /*  FUNCTION
  35.     Change the comment on a file or directory.
  36.     The comment may be any NUL terminated string. The supported
  37.     size varies from filesystem to filesystem.
  38.  
  39.     INPUTS
  40.     name    - name of the file
  41.     comment - new comment for the file or NULL.
  42.  
  43.     RESULT
  44.     !=0 if all went well, 0 else. IoErr() gives additional
  45.     information in that case.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.     29-10-95    digulla automatically created from
  59.                 dos_lib.fd and clib/dos_protos.h
  60.  
  61. *****************************************************************************/
  62. {
  63.     __AROS_FUNC_INIT
  64.     __AROS_BASE_EXT_DECL(struct DosLibrary *,DOSBase)
  65.  
  66.     /* Get pointer to process structure */
  67.     struct Process *me=(struct Process *)FindTask(NULL);
  68.  
  69.     /* Get pointer to I/O request. Use stackspace for now. */
  70.     struct IOFileSys io,*iofs=&io;
  71.  
  72.     /* Prepare I/O request. */
  73.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  74.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  75.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  76.     iofs->IOFS.io_Flags=0;
  77.     iofs->IOFS.io_Command=FSA_SET_COMMENT;
  78.     /* io_Args[0] is the name which is set by DoName(). */
  79.     iofs->io_Args[1]=(IPTR)comment;
  80.     return !DoName(iofs,name);
  81.     __AROS_FUNC_EXIT
  82. } /* SetComment */
  83.